home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
ptv1n6.arc
/
INPUT2.CPP
< prev
next >
Wrap
Text File
|
1991-01-21
|
326b
|
13 lines
// Listing 4: INPUT2.CPP.
// inline assembly input() referencing C++ names
void statistician::input(int i)
{
asm {
mov si, word ptr this // Point to object data with si
mov ax, word ptr i // Load AX with i
add word ptr [si].sum, ax // sum += i
inc word ptr [si].n // n++
}
}